import request from '@/utils/request'

// 查询评论列表
export function listComment(postId) {
	return request({
		url: '/comment/comment/list',
		method: 'get',
		params: postId
	})
}
//查询评论的子评论
export function commentChildren(data) {
	return request({
		url: '/comment/comment/listTree',
		method: 'get',
		params: data
	})
}

// 查询评论详细
export function getComment(id) {
	return request({
		url: '/comment/comment/' + id,
		method: 'get'
	})
}

// 新增评论
export function addComment(data) {
	return request({
		url: '/comment/comment',
		method: 'post',
		data: data
	})
}

// 修改评论
export function updateComment(data) {
	return request({
		url: '/comment/comment',
		method: 'put',
		data: data
	})
}

// 删除评论
export function delComment(id) {
	return request({
		url: '/comment/comment/' + id,
		method: 'delete'
	})
}